package com.jk.util;

import com.jk.util.encrypt.MD5Util;
import com.jk.util.encrypt.SHA1Util;
import org.apache.log4j.Logger;

/**
 * Created by yanghuan on 2015/7/20.
 */
public class TokenUtil {

    private static final Logger logger = Logger.getLogger(NumberUtil.class);

    public static String getAccessTokenBySid(String sid){
        return MD5Util.hash(sid);
    }

    public static String getOpenId(String appId,String id,String ssoAppSecret){
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(appId);
        stringBuffer.append(id);
        stringBuffer.append(ssoAppSecret);
        return SHA1Util.hash(stringBuffer.toString());
    }
}
